<?php 
function up($id, $broi){
	$products = new Products(con());
	$products->update($id, "kolichestvo", $broi);
	return getComponents();
}

function refresh(){
	return getComponents();
}

function removeProduct($id){
	$products = new Products(con());
	$products->remove($id);
	return getComponents();
}

function getComponents(){
	$products = new Products(con());	
	
//	if (isset($_SESSION['selCompCateg']) && strcasecmp($_SESSION['selCompCateg'], "ВСИЧКИ") !=0){
//		$list = $products->get($_SESSION['selCompCateg']);
//	} else {
		$list = $products->getAll();
//	}
	return $list;
}

function change_category($catName){
	$_SESSION['selCompCateg'] = $catName;
	return $catName; 
}


?>